package com.example.designpattenexample.strategy.example;

//单价折扣策略
public class UnitDiscountStrategy extends DiscountStrategy{

    public UnitDiscountStrategy(ShoppingCard card) {
        super(card);
    }

    @Override
    public double getDiscountAmount() {
        System.out.println("优惠折扣：单价75折");
        return (getCard().getUnitPrice() * 0.15) * getCard().getNum()  ;
    }
}
